package com.gravata.enigma.model;

import java.io.Serializable;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable
public class BouquetService extends EntidadeAbstrata {

	private static final long serialVersionUID = -6385073764540310395L;
	public final static String BOUQUET_ID_FIELD_NAME = "bouquet_reference";
	public final static String SERVICE_ID_FIELD_NAME = "service_reference";

	@DatabaseField(id=true,generatedId=false,canBeNull=false)
	private String id;

	@DatabaseField(foreign = true, columnName = BOUQUET_ID_FIELD_NAME,foreignAutoRefresh=true)
	private Bouquet bouquet;

	@DatabaseField(foreign = true, columnName = SERVICE_ID_FIELD_NAME,foreignAutoRefresh=true)
	private Service service;

	@DatabaseField(columnName = "ordem",canBeNull=false)
	private int ordem;


	BouquetService() {
		// TODO Auto-generated constructor stub
	}

	public BouquetService(Bouquet bouquet, Service service,int ordem) {
		this.bouquet=bouquet;
		this.service=service;
		this.ordem=ordem;

		id=bouquet.getId() + " - "+service.getId();
	}

	public Service getService() {
		return service;
	}

	public Bouquet getBouquet() {
		return bouquet;
	}

	public void setOrdem(int ordem) {
		this.ordem = ordem;
	}
	public int getOrdem() {
		return ordem;
	}

	@Override
	public Serializable getId() {
		return id;
	}

}